package state.group;

import java.io.Serializable;

public class HallCall implements Serializable{

	private static final long serialVersionUID = -3550349476246424366L;
	
	private byte floor;
    private byte direction;

    public HallCall(byte floor, byte direction)
    {
        this.floor = floor;
        this.direction = direction;
    }

    public byte getFloor()
    {
        return floor;
    }

    public byte getDirection()
    {
        return direction;
    }
    
    @Override
    public boolean equals(Object o)
    {
        if (this == o)
        {
            return true;
        }
        
        if (o instanceof HallCall)
        {
            HallCall other = (HallCall) o;
            
            if (this.floor != other.floor)
            {
                return false;
            }
            
            if (this.direction != other.direction)
            {
                return false;
            }
            
            return true;
        }
        
        return false;
    }
    
    @Override
    public int hashCode()
    {
        return floor + direction * 256;
    }
    
    public String toString()
    {
        return "<HallCall: " + floor + ", " + direction + ">";
    }

}
